package com.hliushi.chain.example01_right;

/**
 * 财务总监CFO (10000审批权限)
 *
 * @author: hliushi
 * @date: 2023/2/16 22:00
 **/
public class CFO extends Approver {

    private final int MAX_AMOUNT = 10000;


    public CFO(String name) {
        super(name);
    }

    public void approve(int amount) {
        if (amount <= MAX_AMOUNT) {
            System.out.printf("审批通过，报销金额 ¥%s。【总监: %s】\n", amount, name);
        } else {
            System.out.printf("报销金额 ¥%s 已超过上限，驳回申请。【总监: %s】\n", amount, name);
        }
    }
}
